set(SRC_LIST models/PrimitiveDataManager.cpp models/BaseChannel.cpp models/ChannelManager.cpp)

set(CMAKE_CXX_FLAGS "-std=c++11 -O0 -Wall -Wextra -Wno-ignored-qualifiers -Wno-unused-result -shared -fpic")
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

add_library(kernel SHARED ${SRC_LIST})

# 定义移动库文件的自定义命令，使用 $<TARGET_FILE> 生成器表达式
add_custom_command(TARGET kernel POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:kernel> ${PROJECT_SOURCE_DIR}/lib/
)